import {request} from "@utils/http"
import {addLinkValid, updateLinkValid} from "@api/Link/index.valid";

/**
 * @description 获取友链列表
 */
export const getLinkListAPI = (data: any) => {
    return request.post('/link/getLinkList', data)
}

/**
 * @description 获取友链详情
 */
export const getLinkDetailAPI = (id: string | any) => {
    return request({
        url: `/link/getLinkDetail`,
        method: 'post',
        data: {
            id: id
        }
    })
}

/**
 * @description 删除友链
 */

export const deleteLinkAPI = (id: string | any) => {
    return request({
        url: `/link/deleteLink`,
        method: 'delete',
        data: {
            id: id
        }
    })
}

/**
 * @description 编辑友链
 */

export const updateLinkAPI = (data: updateLinkValid) => {
    return request.post('/link/updateLink', data)
}

/**
 * @description 添加友链
 */

export const addLinkAPI = (data: addLinkValid) => {
    return request.post('/link/createLink', data)
}